import request from '@/utils/request'
import request2 from '@/utils/request2'
import { projectApiUrl } from '../config'

/**
 * 分包商进出场台账列表
 * @param parameter
 */
export function getSubcontractorsList(parameter) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/list/page',
    method: 'post',
    data: parameter
  })
}

/**
 * 根据项目id查分包商
 * @param parameter
 */
export function getSubcontractorsByProject(parameter) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/list/distinct/page',
    method: 'post',
    data: parameter
  })
}

/**
 * 查看分包商进出场台账详情
 * @param id
 */
export function getSubcontractorsOne(id) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/detail',
    method: 'get',
    params: id
  })
}
/**
 * 分包商进出场台账统计
 * @param
 */
export function getSubcontractorsTotal(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/listTotal/list',
    method: 'post',
    data
  })
}

/**
 * 新增-进场分包商
 * @param data
 */
export function addSubcontractors(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/save-entry',
    method: 'post',
    data: data
  })
}

/**
 * 编辑 - 进场分包商
 * @param data
 */
export function editEntrySubcontractors(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/edit-entry',
    method: 'post',
    data: data
  })
}

/**
 * 新增-分包商出场设置
 * @param data
 */
export function editSubcontractors(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/edit-exitSet',
    method: 'post',
    data: data
  })
}

/**
 * 修改联系人
 * @param data
 */
export function editUpdateContact(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/updateContact',
    method: 'post',
    data: data
  })
}



/**
 * 查询劳务分包商名称
 * @param data
 */
export function getLoborName(data) {
  return request({
    url: projectApiUrl + '/ledeger/list',
    method: 'get',
    params: data
  })
}
/**
 * @description: 查询分部分项树
 * @param {object} data 接口参数
 * @return {promise}
 */
export function partialList(data) {
  return request2({
    url: projectApiUrl + '/entry-exit-ledger/partial-list',
    method: 'get',
    params: data
  })
}
/**
 * @description: 编辑分部分项
 * @param {object} data 接口参数
 * @return {promise}
 */
export function partial(data) {
  return request2({
    url: projectApiUrl + '/entry-exit-ledger/partial',
    method: 'post',
    data: data
  })
}
/**
 * @description: 查询退回日志
 * @param {object} data 接口参数
 * @return {promise}
 */
export function backList(data) {
  return request2({
    url: projectApiUrl + '/construction/log/back-list',
    method: 'post',
    data: data
  })
}
/**
 * @description: 退回
 * @param {object} data 接口参数
 * @return {promise}
 */
export function drawBack(data) {
  return request2({
    url: projectApiUrl + '/construction/log/draw-back',
    method: 'post',
    data: data
  })
}
/**
 * @description: 提交判断是否有退回
 * @param {object} data 接口参数
 * @return {promise}
 */
export function submitJudgment(data) {
  return request2({
    url: projectApiUrl + '/construction/log/submit-judgment',
    method: 'get',
    params: data
  })
}


/**
 * 分包商月度考核时间配置
 * @param data
 */
export function entryExitLedgerAssessmentTime(data) {
  return request({
    url: projectApiUrl + '/entry-exit-ledger/assessmentTime',
    method: 'post',
    data: data
  })
}





